{% extends "layout.html" %}
{% import 'utils.html' as utils %}
{% block title %}Login - {{ config.NAME }}{% endblock %}
{% include "header.html" %}
{% block content %}
<div class="content pure-u-1 pure-u-md-3-4">
<aside style="width:350px">
Please enter your password!<br/><br/>
<center><form id="login-form" method="POST" style="display:inline">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<input type="password" name="pass" placeholder="password"><br/><br/>
{% if u2f_enabled %}
<input type="hidden" name="resp" id="sig-payload" value="">
{% else %}
{% endif %}
<input type="submit" value="Login" class="pure-button pure-button-success">
</form></center>
</aside>
</div>
{% if u2f_enabled %}
<script>
var p = {{ payload | tojson }};
if (p) {
u2f.sign(p.appId, p.challenge, p.registeredKeys, function(resp) {
if (resp.errorCode) {
console.log(resp)
} else {
document.getElementById('sig-payload').value = JSON.stringify(resp)
document.getElementById('login-form').submit()
}

})
}
</script>
{% endif %}
{% endblock %}
